package org.csu.demo.ioc.service;

import org.csu.demo.ioc.persistence.AccountDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jmx.export.annotation.ManagedResource;
import org.springframework.stereotype.Service;

@Service("accountService")
public class AccountService {
    //按照类型查找，可以设置required
    @Autowired
    private AccountDAO accountDAO;

    public void login(){
        System.out.println("service的login方法");
        accountDAO.find();
    }

    public AccountDAO getAccountDAO() {
        return accountDAO;
    }

    public void setAccountDAO(AccountDAO accountDAO) {
        this.accountDAO = accountDAO;
    }
}
